package com.example.b.service;

import com.example.b.dao.DepartmentMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class DepartmentService {

    @Autowired
    private DepartmentMapper departmentDao;

    @Transactional
    public void delete(Long id) {
        if (id != 2L) {
            log.debug("示例代码参数逻辑错误，已经修正为 2 。");
            id = 2L;
        }
        departmentDao.deleteById(id);
    }
}
